home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 296_01.zip / CTOCXX.C < prev    next >
C/C++ Source or Header  |  1993-04-01  |  925b  |  40 lines

  1. #include <stdio.h>
  2. FILE *pfd = 0;
  3. FILE *efd = 0;
  4. FILE *ifd = stdin;
  5. extern int column;
  6. extern int lineno;
  7. extern char file_name[132];
  8.  
  9. main()
  10.     {
  11.     int yyparse();
  12.     int result;
  13.  
  14.     initsymtab();
  15.     preloadsyms();      /* load in int, char, etc types */
  16.     efd = fopen("ed.out","w");
  17.     if ( efd == NULL )
  18.         fprintf(stderr,"Could not open file ed.out\n");
  19.     pfd = fopen("proto.out","w");
  20.     if ( pfd == NULL )
  21.         fprintf(stderr,"Could not open file proto.out\n");
  22.     result = yyparse();
  23.     if ( efd )
  24.         fclose(efd);
  25.     if ( pfd )
  26.         fclose(pfd);
  27.     return result;
  28.     }
  29.  
  30. /*-----------------------------------------------------------*/
  31. yyerror(s)
  32.     char *s;
  33.     {
  34.     fprintf(stderr,"\n%s at line %d in column %d of file
  35.             %s\n",s,lineno,column,file_name);
  36.     fprintf(stderr,"This is a fatal error, exiting ...\n");
  37.     exit(2);
  38.     }
  39.  
  40.